<template>
  <div>
    <!-- v-model  :value + @input -->
    <input type="checkbox" v-model="checkAll">
    <div>-------</div>
    <input type="checkbox" v-for="item in ary" v-model="item.selected">
  </div>
</template>
<script>
// @ is an alias to /src
export default {
  name: 'XXX',
  data() {
    return {
      ary: [{ selected: true }, { selected: false }, { selected: true }, { selected: true }],
    }
  },
  computed: {
    // checkAll() {
    //   return this.ary.every(item => item.selected)
    // }
    checkAll: {
      get() {
        return this.ary.every(item => item.selected)
      },
      set(val) {
        this.ary.forEach(item => item.selected = val)
      }
    }
  }
}
</script>
<style lang="less">
</style>